Class Layer
- java.lang.Object
-
- com.supermap.mapping.Layer
-
- Direct Known Subclasses:
- LayerGridAggregation, LayerGroup, LayerHeatmap
public class Layer extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description LayerSetting
getAdditionalSetting()
Returns the style setting of a common layer.Layer
getByCaption(java.lang.String caption)
Gets the layer for the specified aliasjava.lang.String
getCaption()
Returns the caption of this layer.GeoRegion
getClipRegion()
Return to the cropping area of the layer.Dataset
getDataset()
Returns the dataset object of this layer.int
getDeduplicateThreshold()
Gets the rarefied threshold value.double
getDeduplicateTolerance()
Gets the rarefied tolerance.java.lang.String
getDescription()
Returns the description of a layer.QueryParameter
getDisplayFilter()
Returns the specified filter condition for the layer display.boolean
getIsSwipe()
获取图层是否使用卷帘效果GeoRegion
getLabelDisplayArea()
获取标签显示范围LayerSettingVectorCache
getLayerSettingVectorCache()
获取矢量图层设置风格int
getLayerWeight()
获取图层权重double
getMaxVisibleScale()
Returns the maximum visible scale of this layer.double
getMinVisibleGeometrySize()
Returns the minimum display size of the geometry object, with the geometric object Bounds wide and the maximum heightdouble
getMinVisibleScale()
Returns the minimum visible scale of this Layer.java.lang.String
getName()
Returns the name of the layer.LayerGroup
getParentGroup()
Gets the group layer the layer belongs to.Selection
getSelection()
Returns the selection object of this layer.double
getSymbolScale()
Return the display scale of symbols.Theme
getTheme()
Gets the thematic objects of the thematic layer.Theme
GetTheme()
Deprecated.java.lang.String
getTimeEndField()
The temporal data must have time attributes to represent the observed starting time and ending time.java.util.Date
getTimeFilterEnding()
Returns the ending time of the filter expression of the layer time.java.util.Date
getTimeFilterStarting()
Returns the starting time of the filter expression of the layer time.java.lang.String
getTimeStartField()
The temporal data must have time attributes to represent the observed starting time and ending time.TimeSpan
getTimeStepInterval()
Returns the time step interval of the temporal dataint
getWebTileMaxLevel()
Get the network data set, the maximum tile display levelSelection
hitTest(Point2D pt, double tolerance)
Returns the selected objects.Selection
hitTestEx(Point pt, int tolerance)
Returns the selected objects.boolean
isClipRegionEnabled()
Returns whether the cropping area is valid.java.lang.Boolean
isDeduplicateEnabled()
Gets whether to rarefyboolean
isDisposed()
Returns whether the object is disposed.boolean
isEditable()
Returns a value indicating whether this layer is editable.java.lang.Boolean
isFastDrawEnabled()
Get whether to draw a fast pattern, default no, this mode is used for large data volume layer browsing and scaling. This mode is not recommended for small data volume and editing maps.boolean
isLabelDisplayAreaEnable()
Get whether the label is displayed in scope.boolean
isSelectable()
Returns whether the objects in the specified layer are selectable.boolean
isSnapable()
Get if the layer is catchable.boolean
isSymbolScalable()
Returns whether to allow scaling symbols with layer zoom.boolean
IsTimeFilterEnable()
Returns whether to enable the time filter of the layer .boolean
isVisible()
Returns whether this layer is visible.boolean
isVisibleScale(double dScale)
Returns a value indicating whether the specified scale is a visible scale.void
removeCache()
Clear the current display cache and refresh againvoid
setAdditionalSetting(LayerSetting layerSetting)
Sets the style setting of a common layer.void
setCaption(java.lang.String value)
Set the title of the layer.void
setClipRegion(GeoRegion geoRegion)
Set the crop area of the layer.void
setClipRegionEnabled(boolean value)
Set whether the clipping area is effective.void
setDataset(Dataset dataset)
Sets the dataset associated with the layer.void
setDeduplicateEnabled(java.lang.Boolean value)
Sets whether to rarefyvoid
setDeduplicateThreshold(int value)
Sets the rarefied threshold value.void
setDeduplicateTolerance(double value)
Sets the rarefied tolerance.void
setDescription(java.lang.String value)
Sets the description of this layer.void
setDisplayFilter(QueryParameter queryParameter)
Sets the specified filter condition for the layer display.void
setEditable(boolean value)
Sets a value indicating whether this layer is editable.void
setFastDrawDataModefied(boolean isModefied)
When data changes in the quickly drawing mode, call the interface to refresh layer data.void
setFastDrawEnabled(java.lang.Boolean value)
Sets whether to use the quickly drawing mode.void
setIsSwipe(boolean bSwipe)
Sets whether to enable the Swipe featurevoid
setLabelDisplayArea(GeoRegion region)
Set the label display rangevoid
setLabelDisplayAreaEnable(boolean value)
Set whether the range of labels is displayedvoid
setLayerWeight(int value)
Set the layer weight, which is only valid for the label layer, and you need to turn on the top layer display of the labelvoid
setMaxVisibleScale(double value)
Returns the maximum visible scale of this layer.void
setMinVisibleGeometrySize(double value)
Set the minimum display size of the geometric object to the geometric object Bounds wide and high the maximum valuevoid
setMinVisibleScale(double value)
Sets the minimum visible scale of this Layer.void
setOpaqueRate(int value)
Sets the opacity of the layer.void
setSelectable(boolean value)
Sets whether the objects in the specified layer are selectable.void
setSnapable(boolean value)
Set whether the layer can be captured.void
setSymbolScalable(boolean value)
Sets whether to allow scaling symbols with layer zoom.void
setSymbolScale(double value)
Return the display scale of symbols.void
setTimeEndField(java.lang.String strField)
The temporal data must have time attributes to represent the observed starting time and ending time.void
setTimeFilterEnable(boolean bEnable)
Sets whether to enable the time filter of the layer .void
setTimeFilterEnding(java.util.Date endTime)
Sets the ending time of the filter expression of the layer time.void
setTimeFilterStarting(java.util.Date startTime)
Sets the starting time of the filter expression of the layer time.void
setTimeStartField(java.lang.String strField)
The temporal data must have time attributes to represent the observed starting time and ending time.void
setTimeStepInterval(TimeSpan timeSpan)
Sets the time step interval of the temporal datavoid
setVisible(boolean value)
Sets whether this layer is visible.void
setWebTileMaxLevel(int level)
Set the network data set to maximize the tile display level.java.lang.String
toXML()
Turns into XML
-
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of the layer. The name of a layer is the unique identifier of this layer in a map. The identifier is not case-sensitive.- Returns:
- The name of the layer.
-
toXML
public java.lang.String toXML()
Turns into XML- Returns:
- String
-
getCaption
public java.lang.String getCaption()
Returns the caption of this layer. The caption of the layer is the display name of the layer. For example in a layout or legend, the display name of the layer is actually the caption of the layer. It is different from the name of the layer.- Returns:
- The title of the layer.
-
setCaption
public void setCaption(java.lang.String value)
Sets the caption of this layer. The caption of the layer is the display name of the layer. For example in a layout or legend, the display name of the layer is actually the caption of the layer. It is different from the name of the layer.- Parameters:
value
- Specifies the title of the layer.
-
getDescription
public java.lang.String getDescription()
Returns the description of a layer.- Returns:
- The description of this layer.
- Default:
- The default value is an empty string.
-
setDescription
public void setDescription(java.lang.String value)
Sets the description of this layer.- Parameters:
value
- Specifies the description of the layer.
-
getDataset
public Dataset getDataset()
Returns the dataset object of this layer. A layer references to a dataset, so a layer corresponds with a dataset.- Returns:
- This layer corresponds to the dataset object.
-
GetTheme
@Deprecated public Theme GetTheme()
Deprecated.Gets the thematic objects of the thematic layer.- Returns:
- Theme This layer corresponds to the thematic map object.
-
getTheme
public Theme getTheme()
Gets the thematic objects of the thematic layer.- Returns:
- Theme This layer corresponds to the thematic map object.
-
getSelection
public Selection getSelection()
Returns the selection object of this layer. The selection is a collection and it contains one or more features that are selected in a layer. Only the features in the selection can be edited. Note that the selection only work on vector dataset. Grid datasets and image datasets don't have selection.- Returns:
- The selection set object in this layer.
-
isSelectable
public boolean isSelectable()
Returns whether the objects in the specified layer are selectable.When you need to make some selections or queries on a layer, you need to set the layer to be selectable. When the layer is selectable, you can select the elements of interest, query its related attributes and statistical information.
- Returns:
- A Boolean value that indicates whether the object in the layer can be selected, true indicates that the object in this layer can be selected, false indicates that the object in this layer is not selectable.
- Default:
- The default value is true, that is, the objects in the layer can be selected.
-
setSelectable
public void setSelectable(boolean value)
Sets whether the objects in the specified layer are selectable.true Indicates that the objects in this layer can be selected, false means that the objects in this layer are not selectable. When you need to make some selections or queries on a layer, you need to set the layer to be selectable. When the layer is selectable, you can select the elements of interest, query its related attributes and statistics.
- Parameters:
value
- Specifies whether objects in the layer can be selected.
-
isEditable
public boolean isEditable()
Returns a value indicating whether this layer is editable. This method indicates whether you can edit the data that this layer references.When the layer is editable, it means that the data referenced by the layer can be modified and edited, through the layer, you can visualize the data editing. When you only want to render the data referenced by the layer or do not want to affect the original data, it is recommended that the layer is set to non-editable to avoid inadvertent operation to modify the data.
- Returns:
- The layer is editable and returns true; false otherwise.
-
setEditable
public void setEditable(boolean value)
Sets a value indicating whether this layer is editable. This method indicates whether you can edit the data that this layer references.When the layer is editable, it means that the data referenced by the layer can be modified and edited, through the layer, you can visualize the data editing. When you only want to render the data referenced by the layer or do not want to affect the original data, it is recommended that the layer is set to non-editable to avoid inadvertent operation to modify the data.
- Parameters:
value
- Whether the layer is editable.
-
isSymbolScalable
public boolean isSymbolScalable()
Returns whether to allow scaling symbols with layer zoom.- Returns:
- A Boolean value that indicates whether the symbol size of the layer is scaled with the graph, true, indicating that the symbol size of the layer is scaled with the graph, false, that does not scale with the graph.
- Default:
- The default value is false, that is, the symbol size of the layer can not be scaled.
-
setSymbolScalable
public void setSymbolScalable(boolean value)
Sets whether to allow scaling symbols with layer zoom.- Parameters:
value
- Specifies whether the symbol size of the layer is scaled with the graph.
-
isVisible
public boolean isVisible()
Returns whether this layer is visible. It returns true if this layer is visible; otherwise it returns false.- Returns:
- Whether the layer is visible.
- Default:
- The default value is true. That layer visible.
-
setVisible
public void setVisible(boolean value)
Sets whether this layer is visible. It returns true if this layer is visible; otherwise it returns false.- Parameters:
value
- Specifies whether the layer is visible.
-
getAdditionalSetting
public LayerSetting getAdditionalSetting()
Returns the style setting of a common layer. TheLayerSettingVector
class is used to set and modify the style of the vector layer.- Returns:
- Normal layer style settings.
-
getMaxVisibleScale
public double getMaxVisibleScale()
Returns the maximum visible scale of this layer. The maximum visible scale of a layer should not be negative. When current display scale of the map is equal to or larger than the maximum visible scale of this layer, this layer will not be displayed.- Returns:
- The maximum visible scale of the layer.
- Default:
- The default value is 0.
-
setMaxVisibleScale
public void setMaxVisibleScale(double value)
Returns the maximum visible scale of this layer. The maximum visible scale of a layer should not be negative. When current display scale of the map is equal to or larger than the maximum visible scale of this layer, this layer will not be displayed.- Parameters:
value
- Specifies the maximum visible scale for the layer.
-
getMinVisibleScale
public double getMinVisibleScale()
Returns the minimum visible scale of this Layer. The minimum visible scale of a layer should not be negative. When current display scale of the map is less than the minimum visible scale of this layer, this layer will not be displayed.- Returns:
- The minimum visible scale of the layer.
- Default:
- The default value is 0.
-
setAdditionalSetting
public void setAdditionalSetting(LayerSetting layerSetting)
Sets the style setting of a common layer. The style settings for vector data, grid data and image data are different. TheLayerSettingVector
class is used to set and modify the styles of the vector dataset.- Parameters:
layerSetting
- Normal layer style settings.
-
setMinVisibleScale
public void setMinVisibleScale(double value)
Sets the minimum visible scale of this Layer. The minimum visible scale of a layer should not be negative. When current display scale of the map is less than the minimum visible scale of this layer, this layer will not be displayed.- Parameters:
value
- Specifies the minimum visible scale for the layer.
-
getDisplayFilter
public QueryParameter getDisplayFilter()
Returns the specified filter condition for the layer display.- Returns:
- QueryParameter The layer displays the filter criteria.
-
setDisplayFilter
public void setDisplayFilter(QueryParameter queryParameter)
Sets the specified filter condition for the layer display.- Parameters:
queryParameter
- The layer displays the filter criteria.
-
hitTest
public Selection hitTest(Point2D pt, double tolerance)
Returns the selected objects. If the distance of the nearest point on the objects from the point to be tested is within the specified tolerance, the object is selected. If the objects that satisfy the condition overlap, they will all be selected and returned.- Parameters:
pt
- To test the point, for the geographic coordinate point.tolerance
- The specified margin is geographically long.- Returns:
- The collection of selected objects.
-
hitTestEx
public Selection hitTestEx(Point pt, int tolerance)
Returns the selected objects. If the distance of the nearest point on the objects from the point to be tested is within the specified tolerance, the object is selected. If the objects that satisfy the condition overlap, they will all be selected and returned.- Parameters:
pt
- To test the point for the point on the screen.tolerance
- Specify the tolerance for the screen coordinates.- Returns:
- The collection of selected objects.
-
isVisibleScale
public boolean isVisibleScale(double dScale)
Returns a value indicating whether the specified scale is a visible scale. If the scale is within the minimum visible scale and the maximum visible scale of this layer, the scale is a visible scale.- Parameters:
dScale
- Specified display scale.- Returns:
- The specified scale returns true for the visual scale; otherwise, false.
-
isDisposed
public boolean isDisposed()
Returns whether the object is disposed. If this method returns true, implementing the the methods of this class will throw an exception, which means the object has been disposed already.- Returns:
- If the object has been released ,returns true; otherwise it returns false.
-
getParentGroup
public LayerGroup getParentGroup()
Gets the group layer the layer belongs to.- Returns:
- object belongs to the grouping layer
-
setDataset
public void setDataset(Dataset dataset)
Sets the dataset associated with the layer. The dataset should be in the same workspace with the current map and the dataset type should be the same with the type of the original dataset. Otherwise, an exception will occur.- Parameters:
dataset
- Layer-related data sets
-
setOpaqueRate
public void setOpaqueRate(int value)
Sets the opacity of the layer.- Parameters:
value
- Opacity, 0-100.
-
removeCache
public void removeCache()
Clear the current display cache and refresh again
-
isSnapable
public boolean isSnapable()
Get if the layer is catchable.- Returns:
- boolean Returns whether the layer can be captured, true indicates that the layer can be captured, false indicates that the layer is not catchable.
-
setSnapable
public void setSnapable(boolean value)
Set whether the layer can be captured.- Parameters:
value
- Whether the layer can be captured, true that the layer can be captured, false that the layer can not be captured.
-
getMinVisibleGeometrySize
public double getMinVisibleGeometrySize()
Returns the minimum display size of the geometry object, with the geometric object Bounds wide and the maximum height- Returns:
- double Minimum display size
-
setMinVisibleGeometrySize
public void setMinVisibleGeometrySize(double value)
Set the minimum display size of the geometric object to the geometric object Bounds wide and high the maximum value- Parameters:
value
- Minimum display size
-
getByCaption
public Layer getByCaption(java.lang.String caption)
Gets the layer for the specified alias- Parameters:
caption
- Layer alias- Returns:
- Specifies the layer of the alias
-
setIsSwipe
public void setIsSwipe(boolean bSwipe)
Sets whether to enable the Swipe feature- Parameters:
bSwipe
- whether to enable the Swipe feature. false is by default.
-
getIsSwipe
public boolean getIsSwipe()
Gets whether to enable the Swipe feature- Returns:
- whether to enable the Swipe feature.
-
getLayerSettingVectorCache
public LayerSettingVectorCache getLayerSettingVectorCache()
Gets the setting style of the vector layer.- Returns:
- Gets the setting style of the vector layer.
-
getSymbolScale
public double getSymbolScale()
Return the display scale of symbols. If the symbol does not zoom with zooming the map (SymbolScalable = False), the symbol size is Style.symbolsize. If the symbol zooms with zooming the map (SymbolScalable = True), the symbol size relates to the layer scale (generally consistent).- Returns:
- double
-
setSymbolScale
public void setSymbolScale(double value)
Return the display scale of symbols. If the symbol does not zoom with zooming the map (SymbolScalable =False), the symbol size is Style.symbolsize. If the symbol zooms with zooming the map (SymbolScalable = True), the symbol size relates to the layer scale (generally consistent).- Parameters:
value
- whether the symbol zooms with zooming the map
-
IsTimeFilterEnable
public boolean IsTimeFilterEnable()
Returns whether to enable the time filter of the layer . True means yes. False is by default.- Parameters:
- -
-
setTimeFilterEnable
public void setTimeFilterEnable(boolean bEnable)
Sets whether to enable the time filter of the layer . True means yes.- Parameters:
- -
-
getTimeStartField
public java.lang.String getTimeStartField()
The temporal data must have time attributes to represent the observed starting time and ending time. The interface is used for returning the field that records all starting times.- Parameters:
- -
-
setTimeStartField
public void setTimeStartField(java.lang.String strField)
The temporal data must have time attributes to represent the observed starting time and ending time. The interface is used for setting the field that records all starting times.- Parameters:
- -
-
getTimeEndField
public java.lang.String getTimeEndField()
The temporal data must have time attributes to represent the observed starting time and ending time. The interface is used for returning the field that records all ending times.- Parameters:
- -
-
setTimeEndField
public void setTimeEndField(java.lang.String strField)
The temporal data must have time attributes to represent the observed starting time and ending time. The interface is used for setting the field that records all ending times.- Parameters:
- -
-
getTimeFilterStarting
public java.util.Date getTimeFilterStarting()
Returns the starting time of the filter expression of the layer time.- Parameters:
- -
-
setTimeFilterStarting
public void setTimeFilterStarting(java.util.Date startTime)
Sets the starting time of the filter expression of the layer time.- Parameters:
- -
-
getTimeFilterEnding
public java.util.Date getTimeFilterEnding()
Returns the ending time of the filter expression of the layer time.- Parameters:
- -
-
setTimeFilterEnding
public void setTimeFilterEnding(java.util.Date endTime)
Sets the ending time of the filter expression of the layer time.- Parameters:
- -
-
getTimeStepInterval
public TimeSpan getTimeStepInterval()
Returns the time step interval of the temporal data- Parameters:
- -
-
setTimeStepInterval
public void setTimeStepInterval(TimeSpan timeSpan)
Sets the time step interval of the temporal data- Parameters:
- -
-
setDeduplicateEnabled
public void setDeduplicateEnabled(java.lang.Boolean value)
Sets whether to rarefy- Parameters:
value
- Whether to rarefy
-
isDeduplicateEnabled
public java.lang.Boolean isDeduplicateEnabled()
Gets whether to rarefy- Returns:
- whether to rarefy.
-
setFastDrawEnabled
public void setFastDrawEnabled(java.lang.Boolean value)
Sets whether to use the quickly drawing mode. No is by default. The mode is used for zooming big data layers.- Parameters:
value
- whether to use the quickly drawing mode
-
isFastDrawEnabled
public java.lang.Boolean isFastDrawEnabled()
Gets whether to use the quickly drawing mode. No is by default. The mode is used for zooming big data layers.- Returns:
- whether to use the quickly drawing mode
-
setFastDrawDataModefied
public void setFastDrawDataModefied(boolean isModefied)
When data changes in the quickly drawing mode, call the interface to refresh layer data. The interface can't work in other modes.- Parameters:
isModefied
- whether data changes
-
setDeduplicateTolerance
public void setDeduplicateTolerance(double value)
Sets the rarefied tolerance. Unit is pixel.- Parameters:
value
- the rarefied tolerance
-
getDeduplicateTolerance
public double getDeduplicateTolerance()
Gets the rarefied tolerance. Unit is pixel.- Returns:
- the rarefied tolerance
-
setDeduplicateThreshold
public void setDeduplicateThreshold(int value)
Sets the rarefied threshold value. Unit is the number of points- Parameters:
value
- the number of points
-
getDeduplicateThreshold
public int getDeduplicateThreshold()
Get the dilution threshold in the number of points.- Return:
- Count of points
-
setLabelDisplayArea
public void setLabelDisplayArea(GeoRegion region)
Set the scope of label display- Parameter:
region
-
-
getLabelDisplayArea
public GeoRegion getLabelDisplayArea()
Get the display range of the label
-
setLabelDisplayAreaEnable
public void setLabelDisplayAreaEnable(boolean value)
Set whether the label is displayed in the range- Parameter:
value
-
-
isLabelDisplayAreaEnable
public boolean isLabelDisplayAreaEnable()
Get the label whether the range is displayed- Return:
-
setLayerWeight
public void setLayerWeight(int value)
Setting the layer weight is only valid for the label layer. You need to turn on the top display of the label.- Parameter:
value
- int
-
getLayerWeight
public int getLayerWeight()
Get layer weights- Return:
- Layer Weight Values
-
setWebTileMaxLevel
public void setWebTileMaxLevel(int level)
Set the network data set to maximize the tile display level. Eg: There are 19 tiles in the vector layer of the sky map, of which level 19 is the blank layer. By setting setWebTileMaxLevel (18), it is possible not to display 19-level tiles, and the magnification map can continue to use 18-level tiles. This function requires turning on Map.setLayerHierarchic(true), which is only valid for WMTS services.- Parameter:
level
-
-
getWebTileMaxLevel
public int getWebTileMaxLevel()
Get the network data set, the maximum tile display level. Return -1 indicates the default value.- Return:
-
getClipRegion
public GeoRegion getClipRegion()
Returns the cropping area of the layer.- Return:
- Returns the cropping area of the layer.
-
setClipRegion
public void setClipRegion(GeoRegion geoRegion)
Set the crop area of the layer.- Parameter:
geoRegion
- The cropping area of the layer.
-
isClipRegionEnabled
public boolean isClipRegionEnabled()
Returns whether the cropping area is valid.The cropping area displayed by the layer is related to the return value of the following methods:
Map.getClipRegion()
,Map.isClipRegionEnabled()
,Layer.getClipRegion()
,Layer.isClipRegionEnabled()
.- Return:
- A Boolean value that specifies whether the clipping area is valid. True means valid, false means invalid.
-
setClipRegionEnabled
public void setClipRegionEnabled(boolean value)
Set whether the cropping area is valid.- Parameter:
value
- A Boolean value specifies whether the cropping area is valid, true means valid, and false means invalid.
-
-